<template>
  <div class="main">
    <!-- 选中为空 -->
    <div v-if="!props.node && !props.line && !props.multi">
      <div class="title">欢迎使用综合能源管理平台</div>

      <div class="group">
        <!-- <a class="star" href="https://github.com/le5le-com/topology" target="_blank">喜欢，点击这里打个star吧</a>
        <a href="https://www.yuque.com/alsmile/topology" target="_blank">使用教程</a>-->
        <a class="star" target="_blank">喜欢，点击这里打个star吧</a>
        <a target="_blank">使用教程</a>
        <br />
        <!-- <a
          href="http://topology.le5le.com/assets/img/topology_wechat.jpg?t=1"
          target="_blank"
        >微信交流群（大群）</a>-->
        <a target="_blank">微信交流群（大群）</a>
        <br />
        <!-- <a href="http://topology.le5le.com/assets/img/topology_wechat2.jpg" target="_blank">微信交流群2</a>
        <br />
        <a href="https://www.yuque.com/alsmile/topology/faq#EVbCgt" target="_blank">联系我们</a>-->
        <a target="_blank">微信交流群2</a>
        <br />
        <a target="_blank">联系我们</a>
      </div>
      <div class="title">项目设置</div>
      <div class="items">
        <div class="flex grid">
          <div>项目名称</div>
        </div>
        <div class="flex grid">
          <div>
            <el-input
              v-model="filename"
              controls-position="right"
              @change="changefilename"
            ></el-input>
          </div>
        </div>
      </div>
      <div class="items">
        <div class="flex grid">
          <div>读取数据库中拓扑</div>
        </div>
        <div class="flex grid">
          <div>
            <el-select
              v-model="filename"
              placeholder="请选择"
              @change="changefilename"
            >
              <el-option
                v-for="item in options2"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
          </div>
        </div>
      </div>
      <div class="title">[Todo] 未来规划</div>
      <ul class="group">
        <li>Github issues</li>
        <li>React demo</li>
        <li>Vue3 demo</li>
        <li>系列教程</li>
      </ul>

      <div class="bottom">
        <div class="title">小提示</div>
        <ul class="group">
          <li>方向键：控制节点移动5个像素</li>
          <li>Ctrl + 方向键：控制节点移动1个像素</li>
          <li>Ctrl + 鼠标移动：移动整个画布</li>
          <li>Ctrl + 鼠标滚轮：缩放</li>
          <li>添加或选中节点，右侧属性支持上传各种图片哦</li>
        </ul>
      </div>
    </div>
    <!-- 选中节点 -->
    <div v-if="props.node">
      <div class="items">
        <div class="flex grid">
          <div>控件ID值</div>
        </div>
        <div class="flex grid">
          <div>
            <el-input
              v-model="props.node.id"
              controls-position="right"
              @change="onChange"
            ></el-input>
          </div>
        </div>
      </div>
      <div class="items">
        <div class="flex grid">
          <div>控件类型</div>
        </div>
        <div class="flex grid">
          <div>
            <el-input
              v-model="props.node.type"
              controls-position="right"
              @change="onChange"
            ></el-input>
          </div>
        </div>
      </div>
      <div class="items">
        <div class="flex grid">
          <div>内容</div>
        </div>
        <div class="flex grid">
          <div>
            <el-input
              v-model="props.node.text"
              controls-position="right"
              @change="onChange"
            ></el-input>
          </div>
        </div>
      </div>
      <div class="title">位置和大小</div>

      <div>
        <div class="flex grid">
          <div>X（px）</div>
          <div class="ml5">Y（px）</div>
        </div>
        <div class="flex grid">
          <div>
            <el-input-number
              v-model="props.node.rect.x"
              controls-position="right"
              @change="onChange"
            ></el-input-number>
          </div>
          <div class="ml5">
            <el-input-number
              v-model="props.node.rect.y"
              controls-position="right"
              @change="onChange"
            ></el-input-number>
          </div>
        </div>
      </div>
      <div>
        <div class="flex grid">
          <div>宽（px）</div>
          <div class="ml5">高（px）</div>
        </div>
        <div class="flex grid">
          <div>
            <el-input-number
              v-model="props.node.rect.width"
              controls-position="right"
              @change="onChange"
            ></el-input-number>
            <!-- <el-input
              v-model="props.node.rect.width"
              controls-position="right"
              @change="onChange"
            ></el-input> -->
          </div>
          <div class="ml5">
            <el-input-number
              v-model="props.node.rect.height"
              controls-position="right"
              @change="onChange"
            ></el-input-number>
            <!-- <el-input
              v-model="props.node.rect.height"
              controls-position="right"
              @change="onChange"
            ></el-input> -->
          </div>
        </div>
      </div>
      <div>
        <div class="flex grid">
          <div>圆角(0-1)</div>
          <div class="ml5">旋转(度)</div>
        </div>
        <div class="flex grid">
          <div>
            <el-input-number
              v-model="props.node.borderRadius"
              controls-position="right"
              @change="onChange"
            ></el-input-number>
          </div>
          <div class="ml5">
            <el-input-number
              v-model="props.node.rotate"
              controls-position="right"
              @change="onChange"
            ></el-input-number>
          </div>
        </div>
      </div>
      <div>
        <div class="flex grid">
          <div>内边距-左</div>
          <div class="ml5">内边距-右</div>
        </div>
        <div class="flex grid">
          <div>
            <el-input-number
              v-model="props.node.paddingLeft"
              controls-position="right"
              @change="onChange"
            ></el-input-number>
          </div>
          <div class="ml5">
            <el-input-number
              v-model="props.node.paddingRight"
              controls-position="right"
              @change="onChange"
            ></el-input-number>
          </div>
        </div>
      </div>
      <div>
        <div class="flex grid">
          <div>内边距-上</div>
          <div class="ml5">内边距-下</div>
        </div>
        <div class="flex grid">
          <div>
            <el-input-number
              v-model="props.node.paddingTop"
              controls-position="right"
              @change="onChange"
            ></el-input-number>
          </div>
          <div class="ml5">
            <el-input-number
              v-model="props.node.paddingBottom"
              controls-position="right"
              @change="onChange"
            ></el-input-number>
          </div>
        </div>
      </div>
      <span>内边距：输入数字表示像素；输入%表示百分比</span>
      <div class="title">样式</div>
      <div>
        <div class="flex grid">
          <div>线条颜色</div>
          <div class="ml5">线条宽度(px)</div>
        </div>
        <div class="flex grid">
          <div>
            <el-color-picker
              v-model="props.node.strokeStyle"
              @change="onChange"
              show-alpha
            ></el-color-picker>
            <!-- <el-input
              v-model="props.node.strokeStyle"
              controls-position="right"
              @change="onChange"
            ></el-input> -->
          </div>
          <div class="ml5">
            <el-input-number
              v-model="props.node.lineWidth"
              controls-position="right"
              @change="onChange"
            ></el-input-number>
          </div>
        </div>
      </div>
      <div>
        <div class="flex grid">
          <div>背景颜色</div>
          <div class="ml5">图片背景颜色</div>
        </div>
        <div class="flex grid">
          <div>
            <el-color-picker
              v-model="props.node.fillStyle"
              @change="onChange"
              show-alpha
            ></el-color-picker>

            <!-- <el-input
              v-model="props.node.fillStyle"
              controls-position="right"
              @change="onChange"
            ></el-input> -->
          </div>
          <div class="ml5">
            <el-color-picker
              v-model="props.node.iconColor"
              controls-position="right"
              @change="onChange"
              show-alpha
            ></el-color-picker>
            <!-- <el-input-number
                v-model="props.node.iconColor"
                controls-position="right"
                @change="onChange"
              ></el-input-number> -->
          </div>
        </div>
      </div>
      <div>
        <div class="flex grid">
          <div>透明度(0-1)</div>
        </div>
        <div class="flex grid">
          <div>
            <el-input-number
              v-model="props.node.globalAlpha"
              controls-position="right"
              @change="onChange"
            ></el-input-number>
          </div>
        </div>
      </div>
      <div class="title">文字</div>
      <div>
        <div class="flex grid">
          <div>字体</div>
          <div class="ml5">大小</div>
        </div>
        <div class="flex grid">
          <div>
            <el-input
              v-model="props.node.font.fontFamily"
              controls-position="right"
              @change="onChange"
            ></el-input>
          </div>
          <div class="ml5">
            <el-input-number
              v-model="props.node.font.fontSize"
              controls-position="right"
              @change="onChange"
            ></el-input-number>
          </div>
        </div>
      </div>
      <div>
        <div class="flex grid">
          <div>颜色</div>
          <div class="ml5">背景</div>
        </div>
        <div class="flex grid">
          <div>
            <!-- <el-input
              v-model="props.node.font.color"
              controls-position="right"
              @change="onChange"
            ></el-input> -->
            <el-color-picker
              v-model="props.node.font.color"
              @change="onChange"
              show-alpha
            ></el-color-picker>
          </div>
          <div class="ml5">
            <el-input
              v-model="props.node.font.fillStyle"
              controls-position="right"
              @change="onChange"
            ></el-input>
          </div>
        </div>
      </div>
      <div>
        <div class="flex grid">
          <div>倾斜</div>
          <div class="ml5">加粗</div>
        </div>
        <div class="flex grid">
          <div>
            <!-- <el-select v-model="value1" placeholder="请选择">
    <el-option
      v-for="item in options"
      :key="item.value"
      :label="item.label"
      :value1="item.value"
      controls-position="right"
              @change="onChange">
    </el-option>
  </el-select> -->
          </div>
          <div class="ml5">
            <el-select v-model="value" placeholder="请选择">
              <el-option
                v-for="item in options"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
          </div>
        </div>
      </div>

      <div v-if="RegExp(/大电网/).test(props.node.text)">
        <div class="title">大电网节点属性</div>
        <div class="items">
          <div class="flex grid">
            <div>额定寿命（年）（KV）</div>
            <div class="ml5">额定容量（KW）</div>
          </div>
          <div class="flex grid">
            <div>
              <el-input-number
                v-model="props.a"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
            <div class="ml5">
              <el-input-number
                v-model="props.node.rect.y"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
          </div>
        </div>
        <div class="items">
          <div class="flex grid">
            <div>内阻</div>
            <div class="ml5">存储性能（KV）</div>
          </div>
          <div class="flex grid">
            <div>
              <el-input-number
                v-model="props.a"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
            <div class="ml5">
              <el-input-number
                v-model="props.node.rect.y"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
          </div>
        </div>
      </div>
      <div v-if="RegExp(/电视/).test(props.node.text)">
        <div class="title">电视节点属性</div>
        <div class="items">
          <div class="flex grid">
            <div>额定寿命（年）（KV）</div>
            <div class="ml5">额定容量（KW）</div>
          </div>
          <div class="flex grid">
            <div>
              <el-input-number
                v-model="props.a"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
            <div class="ml5">
              <el-input-number
                v-model="props.node.rect.y"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
          </div>
        </div>
        <div class="items">
          <div class="flex grid">
            <div>内阻</div>
            <div class="ml5">存储性能（KV）</div>
          </div>
          <div class="flex grid">
            <div>
              <el-input-number
                v-model="props.a"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
            <div class="ml5">
              <el-input-number
                v-model="props.node.rect.y"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
          </div>
        </div>
      </div>
      <div v-if="RegExp(/开关关/).test(props.node.text)">
        <div class="title">开关节点属性</div>
        <div class="items">
          <div class="flex grid">
            <div>额定寿命（年）（KV）</div>
            <div class="ml5">额定容量（KW）</div>
          </div>
          <div class="flex grid">
            <div>
              <el-input-number
                v-model="props.a"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
            <div class="ml5">
              <el-input-number
                v-model="props.node.rect.y"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
          </div>
        </div>
        <div class="items">
          <div class="flex grid">
            <div>内阻</div>
            <div class="ml5">存储性能（KV）</div>
          </div>
          <div class="flex grid">
            <div>
              <el-input-number
                v-model="props.a"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
            <div class="ml5">
              <el-input-number
                v-model="props.node.rect.y"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
          </div>
        </div>
      </div>
      <div v-if="RegExp(/开关开/).test(props.node.text)">
        <div class="title">开关节点属性</div>
        <div class="items">
          <div class="flex grid">
            <div>额定寿命（年）（KV）</div>
            <div class="ml5">额定容量（KW）</div>
          </div>
          <div class="flex grid">
            <div>
              <el-input-number
                v-model="props.a"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
            <div class="ml5">
              <el-input-number
                v-model="props.node.rect.y"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
          </div>
        </div>
        <div class="items">
          <div class="flex grid">
            <div>内阻</div>
            <div class="ml5">存储性能（KV）</div>
          </div>
          <div class="flex grid">
            <div>
              <el-input-number
                v-model="props.a"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
            <div class="ml5">
              <el-input-number
                v-model="props.node.rect.y"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
          </div>
        </div>
      </div>
      <div v-if="RegExp(/蓄电池/).test(props.node.text)">
        <div class="title">蓄电池节点属性</div>
        <div class="items">
          <div class="flex grid">
            <div>额定寿命（年）（KV）</div>
            <div class="ml5">额定容量（KW）</div>
          </div>
          <div class="flex grid">
            <div>
              <el-input-number
                v-model="props.a"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
            <div class="ml5">
              <el-input-number
                v-model="props.node.rect.y"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
          </div>
        </div>
        <div class="items">
          <div class="flex grid">
            <div>内阻</div>
            <div class="ml5">存储性能（KV）</div>
          </div>
          <div class="flex grid">
            <div>
              <el-input-number
                v-model="props.a"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
            <div class="ml5">
              <el-input-number
                v-model="props.node.rect.y"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
          </div>
        </div>
      </div>
      <div v-if="RegExp(/空调/).test(props.node.text)">
        <div class="title">空调节点属性</div>
        <div class="items">
          <div class="flex grid">
            <div>制冷量（W）</div>
            <div class="ml5">输入功率（W）</div>
          </div>
          <div class="flex grid">
            <div>
              <el-input-number
                v-model="props.a"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
            <div class="ml5">
              <el-input-number
                v-model="props.node.rect.y"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
          </div>
        </div>
        <div class="items">
          <div class="flex grid">
            <div>能效比</div>
            <div class="ml5">空调耗电（KV）</div>
          </div>
          <div class="flex grid">
            <div>
              <el-input-number
                v-model="props.a"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
            <div class="ml5">
              <el-input-number
                v-model="props.node.rect.y"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
          </div>
        </div>
      </div>
      <div v-if="RegExp(/电线/).test(props.node.text)">
        <div class="title">电线节点属性</div>
        <div class="items">
          <div class="flex grid">
            <div>电流（A）</div>
            <div class="ml5">电压（kv）</div>
          </div>
          <div class="flex grid">
            <div>
              <el-input-number
                v-model="props.a"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
            <div class="ml5">
              <el-input-number
                v-model="props.node.rect.y"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
          </div>
        </div>
        <div class="items">
          <div class="flex grid">
            <div>内阻</div>
            <div class="ml5">性能（KV）</div>
          </div>
          <div class="flex grid">
            <div>
              <el-input-number
                v-model="props.a"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
            <div class="ml5">
              <el-input-number
                v-model="props.node.rect.y"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
          </div>
        </div>
      </div>
      <div v-if="RegExp(/热/).test(props.node.text)">
        <div class="title">热线节点属性</div>
        <div class="items">
          <div class="flex grid">
            <div>热量（A）</div>
            <div class="ml5">热度（kv）</div>
          </div>
          <div class="flex grid">
            <div>
              <el-input-number
                v-model="props.a"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
            <div class="ml5">
              <el-input-number
                v-model="props.node.rect.y"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
          </div>
        </div>
        <div class="items">
          <div class="flex grid">
            <div>内阻</div>
            <div class="ml5">性能（KV）</div>
          </div>
          <div class="flex grid">
            <div>
              <el-input-number
                v-model="props.a"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
            <div class="ml5">
              <el-input-number
                v-model="props.node.rect.y"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
          </div>
        </div>
      </div>
      <div v-if="RegExp(/冷/).test(props.node.text)">
        <div class="title">冷线节点属性</div>
        <div class="items">
          <div class="flex grid">
            <div>冷量（A）</div>
            <div class="ml5">冷度（kv）</div>
          </div>
          <div class="flex grid">
            <div>
              <el-input-number
                v-model="props.a"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
            <div class="ml5">
              <el-input-number
                v-model="props.node.rect.y"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
          </div>
        </div>
        <div class="items">
          <div class="flex grid">
            <div>内阻</div>
            <div class="ml5">性能（KV）</div>
          </div>
          <div class="flex grid">
            <div>
              <el-input-number
                v-model="props.a"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
            <div class="ml5">
              <el-input-number
                v-model="props.node.rect.y"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
          </div>
        </div>
      </div>
      <div v-if="RegExp(/光/).test(props.node.text)">
        <div class="title">光线节点属性</div>
        <div class="items">
          <div class="flex grid">
            <div>光量（A）</div>
            <div class="ml5">光强度（kv）</div>
          </div>
          <div class="flex grid">
            <div>
              <el-input-number
                v-model="props.a"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
            <div class="ml5">
              <el-input-number
                v-model="props.node.rect.y"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
          </div>
        </div>
        <div class="items">
          <div class="flex grid">
            <div>内阻</div>
            <div class="ml5">性能（KV）</div>
          </div>
          <div class="flex grid">
            <div>
              <el-input-number
                v-model="props.a"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
            <div class="ml5">
              <el-input-number
                v-model="props.node.rect.y"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
          </div>
        </div>
      </div>
      <div v-if="RegExp(/光伏电站/).test(props.node.text)">
        <div class="title">光伏电站节点属性</div>
        <div class="items">
          <div class="flex grid">
            <div>光量（A）</div>
            <div class="ml5">光强度（kv）</div>
          </div>
          <div class="flex grid">
            <div>
              <el-input-number
                v-model="props.a"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
            <div class="ml5">
              <el-input-number
                v-model="props.node.rect.y"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
          </div>
        </div>
        <div class="items">
          <div class="flex grid">
            <div>内阻</div>
            <div class="ml5">性能（KV）</div>
          </div>
          <div class="flex grid">
            <div>
              <el-input-number
                v-model="props.a"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
            <div class="ml5">
              <el-input-number
                v-model="props.node.rect.y"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
          </div>
        </div>
      </div>
      <div v-if="RegExp(/风机/).test(props.node.text)">
        <div class="title">风机节点属性</div>
        <div class="items">
          <div class="flex grid">
            <div>光量（A）</div>
            <div class="ml5">光强度（kv）</div>
          </div>
          <div class="flex grid">
            <div>
              <el-input-number
                v-model="props.a"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
            <div class="ml5">
              <el-input-number
                v-model="props.node.rect.y"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
          </div>
        </div>
        <div class="items">
          <div class="flex grid">
            <div>内阻</div>
            <div class="ml5">性能（KV）</div>
          </div>
          <div class="flex grid">
            <div>
              <el-input-number
                v-model="props.a"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
            <div class="ml5">
              <el-input-number
                v-model="props.node.rect.y"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
          </div>
        </div>
      </div>
      <div v-if="RegExp(/发电机/).test(props.node.text)">
        <div class="title">发电机节点属性</div>
        <div class="items">
          <div class="flex grid">
            <div>电压等级（KV）</div>
            <div class="ml5">额定容量（KW）</div>
          </div>
          <div class="flex grid">
            <div>
              <el-input-number
                v-model="props.a"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
            <div class="ml5">
              <el-input-number
                v-model="props.node.rect.y"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
          </div>
        </div>
        <div class="items">
          <div class="flex grid">
            <div>负载损耗</div>
            <div class="ml5">阻抗电压（KV）</div>
          </div>
          <div class="flex grid">
            <div>
              <el-input-number
                v-model="props.a"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
            <div class="ml5">
              <el-input-number
                v-model="props.node.rect.y"
                controls-position="right"
                @change="onChange"
              ></el-input-number>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      filename: '空白文件',
      options: [
        {
          value: 'normal',
          label: 'normal'
        },
        {
          value: 'blod',
          label: 'blod'
        }
      ],
      options2: [],
      value: '',
      value2: ''
      // val_1:null,
    }
  },
  // props: ['val_1'],

  props: {
    inputname: String,
    require: true,
    props: {
      type: Object,
      require: true
    }
  },
  watch: {
    // inputname: function(newVal) {
    //   this.filename = newVal
    //   console.log('监听器' + newVal + this.filename)
    // }
  },
  mounted() {
    // console.log('inputname' + this.inputname)
    // this.filename = this.inputname
    // this.value = this.props.node.font.fontWeight
    this.searchtopo()
  },
  methods: {
    searchtopo() {
      this.$axios({
        method: 'get',

        url: 'http://127.0.0.1:8082/topology/searchall'
      }).then(res => {
        for (let i = 0; i < res.data.length; i++) {
          console.log(res.data[i].toponame)
          this.options2.push({
            value: res.data[i].toponame,
            label: res.data[i].toponame
          })
          // this.$set(this.options2[i], 'value', res.data[i].toponame)
          // this.$set(this.options2[i], 'label', res.data[i].toponame)
        }
        console.log(this.options2)
      })
    },
    changefilename(value) {
      console.log(this.filename)
      this.$emit('filenamechange', this.filename)
    },
    // 用$emit通知父组件属性改变事件。
    onChange(value) {
      this.props.node.font.fontWeight = this.value
      this.$emit('change', this.props.node)
      // this.$emit('change', this.props.node, this.props.a)
      // this.$emit('change', this.props.a)
      //
      // console.log('数值改变时发生变化')
      // console.log(this.props.a)
      // this.$axios({
      //   method: 'get',
      //   params: {
      //     // tablename:node.data.text+new Date().getTime()
      //     tablename: this.props.node.text,
      //     speed: this.props.a
      //   },
      //   url: 'http://127.0.0.1:8082/add/updateTable'
      // }).then(res => {
      //   // this.props.value.value_1=res.data[0].speed;
      //   // console.log( this.props.value.value_1);
      //   //当选中的时候赋予属性值node
      // })
    }
  }
}
</script>
<style lang="scss">
.el-input-number {
  width: initial;

  line-height: 30px;

  .el-input__inner {
    width: 110px;
    padding-left: 3px;
    height: 34px;
    line-height: 34px;
  }

  .el-input-number__increase {
    line-height: 1.6rem;
  }
}
</style>
<style lang="scss" scoped>
.main {
  padding-left: 6px;
}
.star {
  display: block;
  color: #f60 !important;
  text-decoration: underline;
  margin-bottom: 1rem;
}

.title {
  color: #0d1a26;
  font-weight: 600;
  padding: 0.05rem 0.15rem;
  // padding: 1rem 1rem;
  border-bottom: 1px solid #ccc;
  margin-bottom: 20px;
}
.flex {
  margin-bottom: 10px;
}

.group {
  margin: 0.1rem 0 0.2rem 0.3rem;
  padding: 0;

  a,
  li {
    line-height: 2;
  }

  li {
    list-style: initial;
  }
}

.bottom {
  position: absolute;
  bottom: 0.1rem;
}

// .items {
//   // padding: 0.05rem 0.15rem;
//   padding: 0.5rem 1.5rem;

//   .el-input-number {
//     // width: initial;

//     // line-height: 40px;

//     // .el-input__inner {
//     //   width: 20px;
//     //   padding-left: 0;
//     //   height: 34px;
//     //   line-height: 34px;
//     // }

//     // .el-input-number__increase {
//     //   line-height: 1.6rem;
//     // }
//   }
// }

.formItem {
  margin-bottom: 1rem;
}
</style>
